home *** CD-ROM | disk | FTP | other *** search
/ HTBasic 9.3 / HTBasic 9.3.iso / FLOPPY / SICL / DISK2 / HPIOLIBS.2 / sicl32 / c / sicl.h < prev    next >
Encoding:
C/C++ Source or Header  |  1999-01-29  |  40.0 KB  |  1,254 lines

  1. /* $Header: sicl.h,v 1.234 98/12/10 10:43:24 hmgr Exp $ */
  2. /* Copyright 1992-1993 Hewlett-Packard Company.  All Rights Reserved. */
  3. /*
  4.  * HP Standard Instrument Control Library
  5.  *
  6.  * This file conforms to the HP SICL Spec as specified in I_SICL_REVISION.
  7.  *
  8.  * #define's used (can be #defined by user):
  9.  *   STD_SICL - Disallows non-standard constructs
  10.  *
  11.  * #define's used (not typically set by user)
  12.  *   SICL_H - Prevents multiple inclusion
  13.  *   SICL_NOPROTO - Don't include function prototypes
  14.  *   
  15.  */
  16.  
  17. /*
  18.  * Make sure this file is only included once
  19.  */
  20. #if !defined(SICL_H)
  21. #define SICL_H
  22.  
  23. /*
  24.  * determine which OS we are compiling on
  25.  * Don't use #elif here, some bug in std cpp on hpux. DTS ISLxx14032
  26.  */
  27. #if defined(WIN32) || defined(_WIN32) || defined(__WIN32__)
  28. #define _SICL_WIN32
  29. #if !defined(__BORLANDC__)
  30. #define _SICL_VXI_D64
  31. #endif
  32. #else
  33. #if defined(__MSDOS__)||defined(MSDOS)||defined(_MSDOS)||defined(_WINDOWS)
  34. #define _MS_DOS_WIN
  35. #endif
  36. #endif
  37.  
  38. #if defined(__hpux)
  39. #define _SICL_HPUX
  40. #if defined(__cplusplus)
  41. #define volatile
  42. #endif
  43. #endif
  44. #if defined(__Lynx__) && defined(__68k__)
  45. #define _SICL_LYNX_BE
  46. #endif
  47. #if defined(__Lynx__) && defined(__x86__)
  48. #define _SICL_LYNX_LE
  49. #define _SICL_LYNX_FA            /* This is for Lynx on Fantasia */
  50. #endif
  51.  
  52. /*
  53.  * define out Windows specific keywords if not compiling for Windows
  54.  */
  55. #if !defined(_MS_DOS_WIN)
  56. #define _near
  57. #define _far
  58. #define _huge
  59. #define _pascal
  60. #define _export
  61. #endif
  62.  
  63.  
  64. /*
  65.  * define SICLAPI, SICLAPIV, and SICLCALLBACK appropriately
  66.  */
  67. #if defined(_SICL_WIN32)
  68. #define SICLAPI __cdecl
  69. #define SICLAPIV __cdecl
  70. #define SICLCALLBACK __cdecl
  71. #else
  72. #if defined(_MS_DOS_WIN)
  73. #define SICLCALLBACK _far _pascal _export
  74. #define SICLAPI _far _pascal
  75. #define SICLAPIV _far __cdecl
  76. #else
  77. #define SICLAPI
  78. #define SICLAPIV
  79. #define SICLCALLBACK
  80. #endif
  81. #endif
  82.  
  83.  
  84. /*
  85.  * Support levels:
  86.  */
  87. #define I_SICL_REVISION 39      /* HP SICL Revision 3.9 */
  88. #define I_SICL_LEVEL 3  /* Support Level */
  89. #define I_SICL_FMTIO    /* Support Formatted I/O */
  90. #define I_SICL_GPIB     /* Support GP-IB */
  91. #define I_SICL_VXI      /* Support VXI */
  92. #define I_SICL_LAN      /* Support LAN */
  93. #define I_SICL_RS232    /* Support RS-232 */
  94. #define I_SICL_GPIO     /* Support GPIO */
  95. #define I_SICL_MSIB     /* Support MSIB */
  96.  
  97. /*
  98.  * The following is needed for functions that require va_list in the
  99.  * prototypes.
  100.  */
  101. #if defined(I_SICL_FMTIO)
  102. #include <stdarg.h>
  103. #endif
  104.  
  105. /*
  106.  * Definition of INST:
  107.  */
  108. typedef int INST;
  109.  
  110. /*
  111.  * session types
  112.  */
  113. #define I_SESS_INTF  1
  114. #define I_SESS_DEV   2
  115. #define I_SESS_CMDR  3
  116.  
  117. /*
  118.  * interface types
  119.  */
  120. #define  I_INTF_NONE 0
  121. #define I_INTF_GPIB  1
  122. #define I_INTF_VXI   2
  123. #define I_INTF_RS232 3
  124. #define I_INTF_GPIO  4
  125. /* 5 is reserved -- don't use */
  126. #define I_INTF_USRDEF   6
  127. /* 7 is reserved -- don't use */
  128. #define I_INTF_MSIB  8
  129. #define I_INTF_LAN   9
  130.  
  131. /*
  132.  * iread termination conditions
  133.  */
  134. #define I_TERM_MAXCNT      1
  135. #define I_TERM_CHR      2
  136. #define I_TERM_END      4
  137. #define I_TERM_NON_BLOCKED 8
  138.  
  139. /*
  140.  * ixtrig 'which' values.  Note:  different interface types may have
  141.  * overlapping constants.  However, don't overlap them until it is required.
  142.  */
  143. #define I_TRIG_STD      0x00000001L
  144. #define I_TRIG_ALL      0xffffffffL
  145. #define I_TRIG_TTL0        0x00001000L
  146. #define I_TRIG_TTL1        0x00002000L
  147. #define I_TRIG_TTL2        0x00004000L
  148. #define I_TRIG_TTL3        0x00008000L
  149. #define I_TRIG_TTL4        0x00010000L
  150. #define I_TRIG_TTL5        0x00020000L
  151. #define I_TRIG_TTL6        0x00040000L
  152. #define I_TRIG_TTL7        0x00080000L
  153. #define I_TRIG_ECL0        0x00100000L
  154. #define I_TRIG_ECL1        0x00200000L
  155. #define I_TRIG_ECL2        0x00400000L
  156. #define I_TRIG_ECL3        0x00800000L
  157. #define I_TRIG_EXT0        0x01000000L
  158. #define I_TRIG_EXT1        0x02000000L
  159. #define I_TRIG_EXT2        0x04000000L
  160. #define I_TRIG_EXT3        0x08000000L
  161. #define I_TRIG_CLK0        0x10000000L
  162. #define I_TRIG_CLK1        0x20000000L
  163. #define I_TRIG_CLK2        0x40000000L
  164. #define I_TRIG_CLK10       0x80000000L
  165. #define I_TRIG_CLK100         0x00000800L
  166. #define I_TRIG_SERIAL_DTR               0x00000400L
  167. #define I_TRIG_SERIAL_RTS               0x00000200L
  168. #define I_TRIG_GPIO_CTL0      0x00000100L
  169. #define I_TRIG_GPIO_CTL1      0x00000080L
  170.  
  171. /*
  172.  * ihint values
  173.  */
  174. #define  I_HINT_DONTCARE      0
  175. #define  I_HINT_USEDMA     1
  176. #define  I_HINT_USEPOLL    2
  177. #define  I_HINT_USEINTR    3
  178. #define  I_HINT_SYSTEM     4
  179. #define  I_HINT_IO      5
  180.  
  181. /*
  182.  * isetintr values
  183.  */
  184. /* 1-15 are interface independant */
  185. #define I_INTR_OFF      0 /* Turn off interrupts */
  186. #define I_INTR_INTFACT     1
  187. #define I_INTR_INTFDEACT   2
  188. #define I_INTR_TRIG     3
  189. #define I_INTR_STB      4
  190. #define I_INTR_DEVCLR      5
  191.  
  192. /* 16-31 are interface specific */
  193. /* VXI Interrupts */
  194. #define I_INTR_VXI_SIGNAL     16
  195. #define I_INTR_VXI_SYSRESET      17
  196. #define I_INTR_VXI_VME        18
  197. #define I_INTR_VXI_LLOCK      19
  198. #define I_INTR_VXI_UKNSIG          20
  199. #define I_INTR_VXI_VMESYSFAIL         21
  200. #define I_INTR_VME_IRQ1                 22
  201. #define I_INTR_VME_IRQ2                 23
  202. #define I_INTR_VME_IRQ3                 24
  203. #define I_INTR_VME_IRQ4                 25
  204. #define I_INTR_VME_IRQ5                 26
  205. #define I_INTR_VME_IRQ6                 27
  206. #define I_INTR_VME_IRQ7                 28
  207. #define I_INTR_ANY_SIG                  29
  208. /* GP-IB Interrupts */
  209. #define I_INTR_GPIB_IFC       16
  210. #define I_INTR_GPIB_PPOLLCONFIG     17
  211. #define I_INTR_GPIB_REMLOC    18
  212. #define I_INTR_GPIB_GET       20
  213. #define I_INTR_GPIB_TLAC      21
  214. /* RS-232 Interrupts */
  215. #define I_INTR_SERIAL_DAV               16
  216. #define I_INTR_SERIAL_MSL               17
  217. #define I_INTR_SERIAL_BREAK             18
  218. #define I_INTR_SERIAL_ERROR             19
  219. #define I_INTR_SERIAL_TEMT              20
  220. #define I_INTR_SERIAL_MCL     21
  221. /* GP-IO Interrupts */
  222. #define I_INTR_GPIO_EIR       16
  223. #define I_INTR_GPIO_RDY       17
  224. /* MSIB Interrupts */
  225. #define I_INTR_MSIB_END_RECEIVED 22
  226. #define I_INTR_MSIB_LINK_BROKEN     23
  227. /* 32 maximum isetintr values */
  228. #define I_INTR_MAX      32
  229.  
  230. /*
  231.  * Swap Constants
  232.  *
  233.  * NOTE:  The byte ordering constants are more than OS dependant,
  234.  * but also dependant on the computer it is implemented on.  (i.e.
  235.  * UNIX has been implemented on INTEL machines and Motorola machines.)
  236.  * If your machine is not identified here, you must be porting our
  237.  * code.  You need to create a constant that uniquely identifies
  238.  * your OS and machine and define the correct ordering macro.  For
  239.  * long term support, submit a DTS, with explicite instruction
  240.  * describing the enhancement for you system.
  241.  */
  242. #if defined(_MS_DOS_WIN) || defined(_SICL_WIN32) || defined(_SICL_LYNX_LE)
  243.    /* Little Endian */
  244. #define I_ORDER_LE
  245. #undef  I_ORDER_BE
  246. #endif
  247.  
  248. #if defined(_SICL_HPUX) || defined(_SICL_LYNX_BE)
  249.    /* Big Endian */
  250. #undef  I_ORDER_LE
  251. #define I_ORDER_BE
  252. #endif
  253.  
  254. /* ivxibusstatus values */
  255. #define I_VXI_BUS_TRIGGER      0
  256. #define I_VXI_BUS_LADDR        1
  257. #define I_VXI_BUS_SERVANT_AREA       2
  258. #define I_VXI_BUS_NORMOP       3
  259. #define I_VXI_BUS_CMDR_LADDR      4
  260. #define I_VXI_BUS_MAN_ID       5
  261. #define I_VXI_BUS_MODEL_ID     6
  262. #define I_VXI_BUS_PROTOCOL     7
  263. #define I_VXI_BUS_XPROT        8
  264. #define I_VXI_BUS_SHM_SIZE     9
  265. #define I_VXI_BUS_SHM_ADDR_SPACE 10
  266. #define I_VXI_BUS_SHM_PAGE    11
  267. #define I_VXI_BUS_VXIMXI      12
  268. #define I_VXI_BUS_TRIGSUPP    13
  269.  
  270. /* igpibbusstatus values */
  271. #define I_GPIB_BUS_REM         1
  272. #define I_GPIB_BUS_SRQ         2
  273. #define I_GPIB_BUS_NDAC        3
  274. #define I_GPIB_BUS_SYSCTLR     4
  275. #define I_GPIB_BUS_ACTCTLR     5
  276. #define I_GPIB_BUS_TALKER      6
  277. #define I_GPIB_BUS_LISTENER       7
  278. #define I_GPIB_BUS_ADDR        8
  279. #define I_GPIB_BUS_LINES                 9
  280.  
  281. #define I_GPIB_T1DELAY_MIN               350
  282. #define I_GPIB_T1DELAY_MAX               2400
  283.    
  284. /* values for igpioctrl and igpiostat */
  285. #define  I_GPIO_AUX        1
  286. #define  I_GPIO_CTRL       2
  287. #define  I_GPIO_DATA       3
  288. #define  I_GPIO_INFO       4
  289. #define  I_GPIO_SET_PCTL   5
  290. #define  I_GPIO_STAT       6
  291. #define  I_GPIO_READ_EOI   7
  292. #define  I_GPIO_TEST_ONLY  8
  293. #define  I_GPIO_POLARITY   9
  294. #define  I_GPIO_READ_CLK   10
  295. #define  I_GPIO_PCTL_DELAY 11
  296.  
  297. /* 
  298.  * Note that I_GPIO_CHK_PSTS and I_GPIO_AUTO_HDSK are safely overloaded
  299.  * an igpioctrl request value and a bit mask for I_GPIO_INFO.  This is
  300.  * OK because their values (16 and 32) do not conflict with any other
  301.  * defined igpioctrl values.
  302.  */
  303.  
  304. #define  I_GPIO_CTRL_CTL0  0x01
  305. #define  I_GPIO_CTRL_CTL1  0x02
  306.  
  307. #define  I_GPIO_STAT_STI0  0x01
  308. #define  I_GPIO_STAT_STI1  0x02
  309. #define  I_GPIO_EIR        0x04
  310. #define  I_GPIO_PSTS       0x08
  311. #define  I_GPIO_CHK_PSTS   0x10
  312. #define  I_GPIO_AUTO_HDSK  0x20
  313. #define  I_GPIO_ENH_MODE   0x40
  314. #define  I_GPIO_READY      0x80
  315. #define  I_GPIO_EOI_NONE   0x10000
  316.  
  317. /* RS-232 values */
  318. /* STATUS AND CONTROL CONST  */
  319. #define I_SERIAL_BAUD         1
  320. #define I_SERIAL_PARITY       2
  321. #define I_SERIAL_STOP         3
  322. #define I_SERIAL_WIDTH        4
  323. #define I_SERIAL_FLOW_CTRL    5
  324. #define I_SERIAL_MSL       6
  325. #define I_SERIAL_STAT         7
  326. #define I_SERIAL_RESET        9
  327. #define I_SERIAL_READ_EOI     10
  328. #define I_SERIAL_WRITE_EOI    11
  329. #define I_SERIAL_DUPLEX       12
  330. #define I_SERIAL_READ_BUFSZ      13
  331. #define I_SERIAL_READ_DAV     14
  332.  
  333. /* SERIAL duplex modes */
  334. #define I_SERIAL_DUPLEX_HALF     0x0001
  335. #define I_SERIAL_DUPLEX_FULL     0x0002
  336.  
  337. /* SERIAL UART STATUS */
  338. #define I_SERIAL_DAV       0x0001
  339. #define I_SERIAL_OVERFLOW     0x0002
  340. #define I_SERIAL_PARERR       0x0004
  341. #define I_SERIAL_FRAMING      0x0008
  342. #define I_SERIAL_BREAK        0x0010
  343. #define I_SERIAL_TEMT         0x0020
  344.  
  345. /* FLOW CONTROL CONST  */
  346. #define I_SERIAL_FLOW_NONE    0
  347. #define I_SERIAL_FLOW_XON     1
  348. #define I_SERIAL_FLOW_RTS_CTS    2
  349. #define I_SERIAL_FLOW_DTR_DSR    3
  350.  
  351. /* SERIAL MODEM STATUS LINES  */
  352. #define I_SERIAL_DCD       0x0001
  353. #define I_SERIAL_DSR       0x0002
  354. #define I_SERIAL_CTS       0x0004
  355. #define I_SERIAL_RI        0x0008
  356. #define I_SERIAL_D_DCD        0x0010
  357. #define I_SERIAL_D_DSR        0x0020
  358. #define I_SERIAL_D_CTS        0x0040
  359. #define I_SERIAL_TERI         0x0080
  360.  
  361. /* SERIAL MODEM CONTROL LINES */
  362. #define I_SERIAL_RTS       0x1000
  363. #define I_SERIAL_DTR       0x2000
  364.  
  365. /* SERIAL PARITY VALUES  */
  366. #define I_SERIAL_PAR_NONE     0
  367. #define I_SERIAL_PAR_EVEN     1
  368. #define I_SERIAL_PAR_ODD      2
  369. #define I_SERIAL_PAR_MARK     3
  370. #define I_SERIAL_PAR_SPACE    4
  371. #define I_SERIAL_PAR_IGNORE      5
  372.  
  373. /* SERIAL STOP-BIT VALUES */
  374. #define I_SERIAL_STOP_1       1
  375. #define I_SERIAL_STOP_2       2
  376.  
  377. /* SERIAL CHARACTER WIDTH  */
  378. #define I_SERIAL_CHAR_5       5
  379. #define I_SERIAL_CHAR_6       6
  380. #define I_SERIAL_CHAR_7       7
  381. #define I_SERIAL_CHAR_8       8
  382.  
  383. /* EOI support (used with the I_SERIAL_*_EOI command) */
  384. #define I_SERIAL_EOI_CHR      0x100
  385. #define I_SERIAL_EOI_NONE     0x200
  386. #define I_SERIAL_EOI_BIT8     0x400
  387.  
  388. /*
  389.  * MSIB error types (for imsibseterror)
  390.  */
  391. #define I_MSIB_PERMANENTERR      0
  392. #define I_MSIB_TRANSIENTERR      1
  393.  
  394. /*
  395.  * MSIB commands (for imsibcmd)
  396.  */
  397. #define I_MSIB_CMD_NULL                 0x0000
  398. #define I_MSIB_CMD_END                  0x0001
  399. #define I_MSIB_CMD_SEND_CAPABILITY      0x0002
  400. #define I_MSIB_CMD_RETURN_TO_LOCAL      0x0006
  401. #define I_MSIB_CMD_LOCK_LINK            0x0007
  402. #define I_MSIB_CMD_UNLOCK_LINK          0x0008
  403. #define I_MSIB_CMD_LIGHT_ACTIVE         0x0009
  404. #define I_MSIB_CMD_UNLIGHT_ACTIVE       0x000A
  405. #define I_MSIB_CMD_ERROR_OCCURRED       0x000B
  406. #define I_MSIB_CMD_ERRORS_CLEARED       0x000C
  407. #define I_MSIB_CMD_SEND_STATUS          0x0010
  408. #define I_MSIB_CMD_SEND_ERRORS          0x0011
  409. #define I_MSIB_CMD_SEND_MODULE_ID       0x0012
  410. #define I_MSIB_CMD_SEND_MANUFACTURER    0x0013
  411. #define I_MSIB_CMD_SEND_TIME            0x0014
  412. #define I_MSIB_CMD_LINK_REMOTE          0x0015
  413. #define I_MSIB_CMD_LINK_LOCAL           0x0016
  414. #define I_MSIB_CMD_SEND_MODEL_NUMBER    0x0017
  415. #define I_MSIB_CMD_SEND_SERIAL_NUMBER   0x0018
  416. #define I_MSIB_CMD_SEND_FIRMWARE_REV    0x0019
  417. #define I_MSIB_CMD_STATUS               0x0600
  418. #define I_MSIB_CMD_SET_IEEE_ADDRESS     0x0700
  419.  
  420. /*
  421.  * imap 'mapspace' values
  422.  */
  423. #define I_MAP_A16    0x0000
  424. #define I_MAP_A24    0x0001
  425. #define I_MAP_A32    0x0002
  426. #define I_MAP_VXIDEV    0x0003
  427. #define I_MAP_EXTEND    0x0004
  428. #define I_MAP_INTFREG      0x0005
  429. #define I_MAP_SHARED       0x0006
  430. #define I_MAP_AM     0x8000
  431. /*
  432.  *  For E1489 MXI
  433.  */
  434. #define I_MAP_A16_L             0x0007
  435. #define I_MAP_A16_D32           I_MAP_A16_L  
  436. #define I_MAP_A24_L             0x0008
  437. #define I_MAP_A24_D32           I_MAP_A24_L  
  438. #define I_MAP_A24_BLK           0x0009
  439. #define I_MAP_A24_BLK_L         0x000a
  440. #define I_MAP_A32_L             0x000b
  441. #define I_MAP_A32_D32           I_MAP_A32_L  
  442. #define I_MAP_A32_BLK           0x000c
  443. #define I_MAP_A32_BLK_L         0x000d
  444. #define I_MAP_A16_SM            0x000e  /* MXI supervisory mode access */
  445. #define I_MAP_A24_SM            0x000f  /* MXI supervisory mode access */
  446. #define I_MAP_A32_SM            0x0010  /* MXI supervisory mode access */
  447. #define I_MAP_A16_SM_L          0x0011  /* MXI SM D32 */
  448. #define I_MAP_A16_SM_D32        I_MAP_A16_SM_L
  449. #define I_MAP_A24_SM_L          0x0012  /* MXI SM D32 */
  450. #define I_MAP_A24_SM_D32        I_MAP_A24_SM_L
  451. #define I_MAP_A32_SM_L          0x0013  /* MXI SM D32 */
  452. #define I_MAP_A32_SM_D32        I_MAP_A32_SM_L
  453.  
  454. /*
  455.  * Error Codes
  456.  */
  457. #define I_ERR_NOERROR   0
  458. #define I_ERR_SYNTAX 1
  459. #define I_ERR_SYMNAME   2
  460. #define I_ERR_BADADDR   3
  461. #define I_ERR_BADID  4
  462. #define I_ERR_PARAM  5
  463. #define I_ERR_NOCONN 6
  464. #define I_ERR_NOPERM 7
  465. #define I_ERR_NOTSUPP   8
  466. #define I_ERR_NORSRC 9
  467. #define I_ERR_NOINTF 10
  468. #define I_ERR_LOCKED 11
  469. #define I_ERR_NOLOCK 12
  470. #define I_ERR_BADFMT 13
  471. #define I_ERR_DATA   14
  472. #define I_ERR_TIMEOUT   15
  473. #define I_ERR_OVERFLOW  16
  474. #define I_ERR_IO  17
  475. #define I_ERR_OS  18
  476. #define I_ERR_BADMAP 19
  477. #define I_ERR_NODEV  20
  478. #define I_ERR_INVLADDR  21
  479. #define I_ERR_NOTIMPL   22
  480. #define I_ERR_ABORTED   23
  481. #define I_ERR_BADCONFIG 24
  482. #define  I_ERR_NOCMDR   25
  483. #define I_ERR_VERSION   26
  484. #define I_ERR_NESTEDIO  27
  485. #define I_ERR_BUSY      28
  486. #if !defined(STD_SICL)
  487. #define I_ERR_CONNEXISTS    29
  488. #define I_ERR_BUSERR        30
  489. #define I_ERR_BUSERR_RETRY  31
  490. #define I_ERR_INTERNAL     128
  491. #define I_ERR_INTERRUPT    129
  492. #define I_ERR_UNKNOWNERR   130
  493. #endif
  494.  
  495. /*
  496.  * These are the buffer sizes for formatted I/O.  These will become
  497.  * a part of standard sicl.
  498.  * NOTE:  These numbers are tuned for HP-UX performance.
  499.  */
  500. #define I_READ_BUF_SZ   4096
  501. #define I_WRITE_BUF_SZ  128
  502.  
  503. #define I_BUF_READ      0x01
  504. #define I_BUF_WRITE     0x02
  505. #define I_BUF_DISCARD_READ 0x04
  506. #define I_BUF_DISCARD_WRITE   0x08
  507. #define I_BUF_WRITE_END    0x10
  508.  
  509.    /*
  510.     * LU info structure
  511.     * Only some of these fields are documented in SICL, others are
  512.     * documented in TULIP.
  513.     */
  514.    typedef struct lu_info {
  515.       long logical_unit;   /* Documented:  SICL/TULIP (hwconfig.cf) */
  516.       char symname[32];    /* Documented:  SICL/TULIP (hwconfig.cf) */
  517.       char cardname[32];   /* Documented:  SICL/TULIP (xxx_getentry) */
  518.       long filler;      /* Filler - Needed for backward compatability */
  519.       long intftype;    /* Documented:  SICL/TULIP (xxx_getentry) */
  520.       long location;    /* Documented:  TULIP      (hwconfig.cf) */
  521.       long busaddr;     /* Documented:  TULIP      (hwconfig.cf) */
  522.       char _far * hwarg[16];  /* Documented: TULIP    (hwconfig.cf) */
  523.       char visaname[32];        /* interface name used for VISA */   
  524.       long filler2[4];     /* Filler - Needed for future expansion  */
  525.    } lu_info;
  526.  
  527.    /*
  528.     * ivxirminfo structure
  529.     */
  530.    struct vxiinfo {
  531.       /* Device Identification */
  532.       short laddr;      /* Logical Address */
  533.       char name[16];    /* Symbolic Name */
  534.       char manuf_name[16]; /* Manufacturer Name */
  535.       char model_name[16]; /* Model Name */
  536.       unsigned short man_id;  /* Manufacturer ID */
  537.       unsigned short model;   /* Model Code */
  538.       unsigned short devclass;   /* Device Class */
  539.       
  540.       /* Self Test Status */
  541.       short selftest;      /* 1=PASSED, 0=FAILED */
  542.       
  543.       /* Location of Device */
  544.       short cage_num;      /* Cardcage Number */
  545.       short slot;    /* slot number, -1 is unknown, -2 is MXI */
  546.       
  547.       /* Device Information */
  548.       unsigned short protocol;   /* Value of protocol register */
  549.       unsigned short x_protocol;/* Results of Read Protocol WS command */
  550.       unsigned short servant_area;/* Value of servant area */
  551.       
  552.       /* Memory Information */
  553.       /* page size is 256 bytes for A24 and 64K bytes for A32 */
  554.       unsigned short addrspace;  /* 24=A24, 32=A32, 0=none */
  555.       unsigned short memsize; /* Amount of memory in pages */
  556.       unsigned short memstart;   /* Start of memory in pages */
  557.       
  558.       /* Misc. Information */
  559.       short slot0_laddr;   /* LADDR of slot 0 device, -1 if unknown */
  560.       short cmdr_laddr;    /* LADDR of commander, -1 if top level */
  561.       
  562.       /* Interrupt Information */
  563.       short int_handler[8];   /* List of interrupt handlers */
  564.       short interrupter[8];   /* List of interrupters */
  565.       
  566.       short fill[10];      /* Unused */
  567.    };
  568.  
  569.    /*
  570.     * vxiinfo structure values
  571.     */
  572. #define I_VXI_DEVCLASS_MEMORY 0x0000
  573. #define I_VXI_DEVCLASS_EXTENDED  0x4000
  574. #define I_VXI_DEVCLASS_MSGBASED  0x8000
  575. #define I_VXI_DEVCLASS_REGBASED  0xc000
  576.  
  577.    struct msibinfo {
  578.       char capability[127];   /* response to SEND CAPABILITY command */
  579.       char capability_length; /* capability may contain NULL bytes */
  580.       /* the rest are NULL-terminated strings */
  581.       char module_id[128]; /* response to SEND MODULE ID */
  582.       char mfg_id[128];    /* response to SEND MANUFACTURER ID */
  583.       char model_number[128]; /* response to SEND MODEL NUMBER */
  584.       char serial_number[128];   /* response to SEND SERIAL NUMBER */
  585.       char firmware_rev[128]; /* response to SEND FIRMWARE REVISION */
  586.    };
  587.  
  588. /* Non-Standard SICL Defines */
  589. #if !defined(STD_SICL)
  590.    /* Trace defines */
  591. #define  trace_off   0
  592. #define  trace_user  1
  593. #define  trace_inout 2
  594. #define  trace_action   3
  595. #define  trace_detail   4
  596. #define trace_xdetail   5
  597.    /* Configuration file defines */
  598.    /* Bus types (int bustype): */
  599. #define  I_BUS_INT   0  /* Internal Bus */
  600. #define  I_BUS_ISA   1  /* ISA Bus */
  601. #define  I_BUS_EISA  2  /* EISA Bus */
  602. #define  I_BUS_DIO   3  /* DIO I/II Bus */
  603. #define  I_BUS_VME   4  /* VME Bus */
  604. #define I_BUS_USRLND    5       /* Userland driver */
  605. #define  I_BUS_PCI   6  /* PCI Bus */
  606.    /* Bus types -- USE I_BUS_*, not these!!! (int bustype): */
  607. /*
  608.  * These are also defined in pilconfig.h.  If you change these
  609.  * you MUST also change the matching ones in pilconfig.h.
  610.  */
  611. #if !defined(CFG_BUS_INT)
  612. #define  CFG_BUS_INT I_BUS_INT
  613. #define  CFG_BUS_CORE   I_BUS_INT
  614. #define  CFG_BUS_ISA I_BUS_ISA
  615. #define  CFG_BUS_EISA   I_BUS_EISA
  616. #define  CFG_BUS_DIO I_BUS_DIO
  617. #define  CFG_BUS_VME I_BUS_VME
  618. #define CFG_BUS_USRLND  I_BUS_USRLND
  619. #define  CFG_BUS_PCI I_BUS_PCI
  620. /* Interface types -- USE I_INTF_*, not these!!! (int intftype): */
  621. #define  CFG_INTF_HPIB  I_INTF_GPIB /* GPIB Interface */
  622. #define  CFG_INTF_VXI   I_INTF_VXI  /* VXI Interface */
  623. #define  CFG_INTF_RS232 I_INTF_RS232   /* RS-232 Interface */
  624. #define  CFG_INTF_GPIO  I_INTF_GPIO /* GPIO Interface */
  625. #define  CFG_INTF_DIL   5     /* DIL Interface */
  626. #define CFG_INTF_USRDEF I_INTF_USRDEF   /* User-defined Interface type */
  627. #endif
  628. #endif
  629.  
  630.  
  631. #if ! defined(SICL_NOPROTO)
  632.  
  633. /* See if C++ or not */
  634. #if defined(__cplusplus)
  635.    extern "C" {
  636. #endif
  637.  
  638. #if defined(__STDC__) || defined(__cplusplus) || defined(_MS_DOS_WIN) || defined (_SICL_WIN32)
  639.  
  640. /* Version Information */
  641. int SICLAPI iversion(int _far *siclversion,int _far *implversion);
  642. int SICLAPI idrvrversion(INST id,int _far *specversion,int _far *implversion);
  643.  
  644. /* Open/Close */
  645. INST SICLAPI iopen(char _far *addr);
  646. int SICLAPI iclose(INST id);
  647. INST SICLAPI igetintfsess(INST id);
  648.  
  649. /* Write/Read */
  650. int SICLAPI iwrite (
  651.    INST id,
  652.    char _far *buf,
  653.    unsigned long datalen,
  654.    int endi,
  655.    unsigned long _far *actual
  656. );
  657. int SICLAPI iread (
  658.    INST id,
  659.    char _far *buf,
  660.    unsigned long bufsize,
  661.    int _far *reason,
  662.    unsigned long _far *actual
  663. );
  664. int SICLAPI itermchr(INST id,int tchr);
  665. int SICLAPI igettermchr(INST id,int _far *tchr);
  666.  
  667. /* Formatted I/O */
  668. int SICLAPIV iprintf (INST id, const char _far *fmt, ...);
  669. int SICLAPIV ivprintf (INST id, const char _far *fmt, va_list ap);
  670. int SICLAPIV isprintf (char _far *user_buf, const char _far *fmt, ...);
  671. int SICLAPIV isvprintf (char _far *user_buf, const char _far *fmt, va_list ap);
  672.  
  673. int SICLAPIV iscanf (INST id, const char _far *fmt, ...);
  674. int SICLAPIV ivscanf (INST id, const char _far *fmt, va_list ap);
  675. int SICLAPIV isscanf (char _far *user_buf, const char _far *fmt, ...);
  676. int SICLAPIV isvscanf (char _far *user_buf, const char _far *fmt, va_list ap);
  677.  
  678. int SICLAPIV ipromptf (
  679.    INST id, 
  680.    const char _far *writefmt, 
  681.    const char _far *readfmt, 
  682.    ...
  683. );
  684. int SICLAPIV ivpromptf (
  685.    INST id, 
  686.    const char _far *writefmt, 
  687.    const char _far *readfmt, 
  688.    va_list ap
  689. );
  690.  
  691. int SICLAPI ifwrite (
  692.    INST id, 
  693.    char _far *buf, 
  694.    unsigned long datalen, 
  695.    int end, 
  696.    unsigned long _far *actualcnt
  697. );
  698. int SICLAPI ifread (
  699.    INST id, 
  700.    char _far *buf, 
  701.    unsigned long bufsize, 
  702.    int _far *reason, 
  703.    unsigned long _far *actualcnt
  704. );
  705.  
  706. int SICLAPI iflush (INST id, int mask);
  707. int SICLAPI isetbuf (INST id, int mask, int size);
  708. int SICLAPI isetubuf (INST id, int mask, int size, char _far *buf);
  709.  
  710. /* Device/Interface Control */
  711. int SICLAPI iclear(INST id);
  712. int SICLAPI iabort(INST id);
  713. int SICLAPI ilocal (INST id);
  714. int SICLAPI iremote (INST id);
  715. int SICLAPI ireadstb(INST id,unsigned char _far *stb);
  716. int SICLAPI itrigger(INST id);
  717. int SICLAPI ixtrig(INST id,unsigned long which);
  718. int SICLAPI ihint(INST id,int hint);
  719.  
  720. /* Commander Sessions */
  721. int SICLAPI isetstb(INST id, unsigned char stb);
  722.  
  723. /* Service Requests */
  724. typedef void (SICLCALLBACK *srqhandler_t)(INST);
  725. int SICLAPI ionsrq(INST id,srqhandler_t shdlr);
  726. int SICLAPI igetonsrq(INST id, srqhandler_t _far *shdlr);
  727.  
  728. /* Interrupts */
  729. typedef void (SICLCALLBACK *intrhandler_t)(INST,long,long);
  730. int SICLAPI ionintr(INST id,intrhandler_t ihdlr);
  731. int SICLAPI igetonintr(INST id, intrhandler_t _far * ihdlr);
  732. int SICLAPI isetintr(INST id,int intnum,long secval);
  733.  
  734. /* Asynchronous Events Control */
  735. int SICLAPI iintroff(void);
  736. int SICLAPI iintron(void);
  737. int SICLAPI iwaithdlr(long timeout);
  738.  
  739. /* Locking */
  740. int SICLAPI ilock(INST id);
  741. int SICLAPI iunlock(INST id);
  742. int SICLAPI isetlockwait(INST id,int flag);
  743. int SICLAPI igetlockwait(INST id,int _far *flag);
  744.  
  745. /* Timeouts */
  746. int SICLAPI itimeout(INST id,long tval);
  747. int SICLAPI igettimeout(INST id,long _far *tval);
  748.  
  749. /* Misc. Functions */
  750. int SICLAPI igetaddr(INST id,char _far * _far *addr);
  751. int SICLAPI isetdata(INST id,void _far *data);
  752. int SICLAPI igetdata(INST id,void _far * _far *data);
  753. int SICLAPI igetintftype(INST id,int _far *pdata);
  754. int SICLAPI igetsesstype(INST id,int _far *pdata);
  755. int SICLAPI igetdevaddr(INST id,int _far *prim, int _far *sec);
  756. int SICLAPI igetlu(INST id, int _far *lu);
  757. int SICLAPI ibeswap(char _far *addr,unsigned long length,int datasize);
  758. int SICLAPI ileswap(char _far *addr,unsigned long length,int datasize);
  759. int SICLAPI iswap(char _far *addr,unsigned long length,int datasize);
  760. int SICLAPI igetlulist(int _far * _far *list);
  761. int SICLAPI igetluinfo(int lu,struct lu_info _far *result);
  762. int SICLAPI igetgatewaytype(INST id,int _far *pdata);
  763. void SICLAPI siclExplicitlyLoaded();
  764. void SICLAPI ionexitclose();
  765.  
  766. /* Error Handling */
  767. typedef void (SICLCALLBACK *errorproc_t)(INST,int);
  768. int SICLAPI ionerror(errorproc_t);
  769. int SICLAPI igetonerror(errorproc_t _far *);
  770. void SICLCALLBACK I_ERROR_EXIT(INST,int);
  771. void SICLCALLBACK I_ERROR_NO_EXIT(INST,int);
  772. int SICLAPI igeterrno (void);
  773. char _far * SICLAPI igeterrstr (int);
  774. void SICLAPI icauseerr (INST id, int errcode, int flag);
  775.  
  776. /* RS-232 specific functions */
  777. int SICLAPI iserialmclctrl (INST id, int sline, int state);
  778. int SICLAPI iserialmclstat (INST id, int sline, int _far *state);
  779. int SICLAPI iserialctrl (INST id, int request, unsigned long setting);
  780. int SICLAPI iserialstat (INST id, int request, unsigned long _far *result);
  781. int SICLAPI iserialbreak (INST id);
  782.  
  783. /* VXI Specific functions */
  784.    int SICLAPI ivxibusstatus(INST id,int request,unsigned long _far *result);
  785.    int SICLAPI ivxiwaitnormop(INST id);
  786.    int SICLAPI ivxitrigon(INST id,unsigned long which);
  787.    int SICLAPI ivxitrigoff(INST id,unsigned long which);
  788.    int SICLAPI ivxitrigroute(INST id,unsigned long in_which,unsigned long out_which);
  789.    int SICLAPI ivxigettrigroute(INST id,unsigned long which,unsigned long _far *route);
  790.    int SICLAPI ivxiws(INST id,unsigned short wscmd,unsigned short _far *wsresp,unsigned short _far *rpe);
  791.    int SICLAPI ivxiservants(INST id,int maxnum,int _far *list);
  792.    int SICLAPI ivxirminfo(INST id,int laddr, struct vxiinfo _far *info);
  793.  
  794. #if defined(_MS_DOS_WIN) || defined(_SICL_WIN32)
  795.    int  SICLAPI igetvberrbase (short *);
  796.    int  SICLAPI isetvberrbase (short);
  797.    void SICLAPI ibpoke(unsigned volatile char _far *addr, unsigned char value);
  798.    void SICLAPI iwpoke(unsigned volatile short _far *addr,unsigned short value);
  799.    void SICLAPI ilpoke(unsigned volatile long _far *addr, unsigned long value);
  800.    unsigned char SICLAPI ibpeek(unsigned volatile char _far *addr);
  801.    unsigned short SICLAPI iwpeek(unsigned volatile short _far *addr);
  802.    unsigned long SICLAPI ilpeek(unsigned volatile long _far *addr);
  803. #endif
  804.  
  805. /* new map/peek/poke/move routines */
  806.    unsigned long SICLAPI imapx(INST id, int mapspace, unsigned int pagestart, unsigned int pagecnt);
  807.    int SICLAPI iunmapx(INST id, unsigned long handle, int mapspace, unsigned int pagestart, unsigned int pagecnt);
  808.    int SICLAPI iderefptr(INST id, unsigned long handle, unsigned char *value);
  809.    int SICLAPI ipeekx8( INST id, unsigned long handle, unsigned long offset, unsigned char  *value);
  810.    int SICLAPI ipeekx16(INST id, unsigned long handle, unsigned long offset, unsigned short *value);
  811.    int SICLAPI ipeekx32(INST id, unsigned long handle, unsigned long offset, unsigned long  *value);
  812.    int SICLAPI ipokex8( INST id, unsigned long handle, unsigned long offset, unsigned char  value);
  813.    int SICLAPI ipokex16(INST id, unsigned long handle, unsigned long offset, unsigned short value);
  814.    int SICLAPI ipokex32(INST id, unsigned long handle, unsigned long offset, unsigned long  value);
  815. #if defined (_SICL_VXI_D64)
  816.    int SICLAPI ipeekx64(INST id, unsigned long handle, unsigned long offset, unsigned __int64 *value);
  817.    int SICLAPI ipokex64(INST id, unsigned long handle, unsigned long offset, unsigned __int64 value);
  818. #endif
  819.    int SICLAPI iblockmovex(INST id,
  820.                       unsigned long src_handle,
  821.                       unsigned long src_offset,
  822.                       int           src_width,
  823.                       int           src_increment,
  824.                       unsigned long dest_handle,
  825.                       unsigned long dest_offset,
  826.                       int           dest_width,
  827.                       int           dest_increment,
  828.                       unsigned long cnt,
  829.                       int           swap
  830.                      );
  831.  
  832. /* GP-IB Specific functions */
  833.    int SICLAPI igpibbusstatus (INST id, int request, int _far *result);
  834.    int SICLAPI igpibppoll (INST id, unsigned int _far *result);
  835.    int SICLAPI igpibppollconfig (INST id, int cval);
  836.    int SICLAPI igpibppollresp (INST id, int sval);
  837.    int SICLAPI igpibpassctl (INST id, int busaddr);
  838.    int SICLAPI igpibrenctl (INST id, int ren);
  839.    int SICLAPI igpibatnctl (INST id, int atnval);
  840.    int SICLAPI igpibsendcmd (INST id, char _far *buf, int length);
  841.    int SICLAPI igpibllo (INST id);
  842.    int SICLAPI igpibbusaddr (INST id, int busaddr);
  843.    int SICLAPI igpibgett1delay (INST id, int _far *delay);
  844.    int SICLAPI igpibsett1delay (INST id, int delay);
  845.    int SICLAPI igpibpulseifc (INST id);
  846.  
  847. /* GPIO Specific functions */
  848. int SICLAPI igpioctrl(INST id,int request,unsigned long setting);
  849. int SICLAPI igpiostat(INST id,int request,unsigned long _far *result);
  850. int SICLAPI igpiosetwidth(INST id,int width);
  851. int SICLAPI igpiogetwidth(INST id,int _far *width);
  852.  
  853. /* MSIB Specific functions */
  854. int SICLAPI imsibeventmask(INST id,unsigned char mask);
  855. int SICLAPI imsibcmd(INST id,unsigned int cmd,int row,int column,
  856.            char _far *resp,unsigned long bufsize,
  857.            unsigned long _far *actualcnt);
  858. int SICLAPI imsibseterror(INST id,int row,int column,
  859.                 char _far *errtext,int errtype,int _far *msiberr);
  860. int SICLAPI imsibclearerror(INST id,int msiberr);
  861. int SICLAPI imsibinfo(INST id,int row,int column,
  862.             struct msibinfo _far *info);
  863. int SICLAPI imsibmodule(INST id,int row,int column,int _far *result);
  864. int SICLAPI imsibsetstb(INST id,unsigned char stb);
  865.  
  866. /* LAN Specific functions */
  867. int SICLAPI ilantimeout(INST id,long tval);
  868. int SICLAPI ilangettimeout(INST id,long _far *tval);
  869.  
  870. /* Map routines */
  871. char _far * SICLAPI imap(INST id,int mapspace,unsigned int pagestart,unsigned int pagecnt,char _far *suggested);
  872. int SICLAPI iunmap(INST id,char _far *addr,int mapspace,unsigned int pagestart,unsigned int pagecnt);
  873. int SICLAPI imapinfo(INST id,int mapspace,int _far *numwindows,int _far *winsize);
  874.  
  875. /* block copy and fifo routines */
  876. int SICLAPI ibblockcopy(INST id, unsigned char _far *src, unsigned char _far *dest,
  877.                 unsigned long cnt);
  878. int SICLAPI iwblockcopy(INST id, unsigned short _far *src, unsigned short _far *dest,
  879.                 unsigned long cnt, int swap);
  880. int SICLAPI ilblockcopy(INST id, unsigned long _far *src, unsigned long _far *dest,
  881.                 unsigned long cnt, int swap);
  882. int SICLAPI ibpushfifo(INST id, unsigned char _far *src, unsigned char _far *fifo,
  883.                unsigned long cnt);
  884. int SICLAPI iwpushfifo(INST id, unsigned short _far *src,unsigned short _far *fifo,
  885.                unsigned long cnt, int swap);
  886. int SICLAPI ilpushfifo(INST id, unsigned long _far *src, unsigned long _far *fifo,
  887.                unsigned long cnt, int swap);
  888. int SICLAPI ibpopfifo(INST id, unsigned char _far *fifo, unsigned char _far *dest,
  889.               unsigned long cnt);
  890. int SICLAPI iwpopfifo(INST id, unsigned short _far *fifo, unsigned short _far *dest,
  891.               unsigned long cnt, int swap);
  892. int SICLAPI ilpopfifo(INST id, unsigned long _far *fifo, unsigned long _far *dest,
  893.               unsigned long cnt, int swap);
  894. int SICLAPI icmd(INST,long,int,int,void _far *); /* Send non-standard commands to driver */
  895. /* These are not standard SICL routines */
  896. #if !defined(STD_SICL)
  897.    int SICLAPI itrace(int level); /* Turn on tracing */
  898.    int SICLAPI isetcscpidata(INST id, void _far *data);
  899.    int SICLAPI igetcscpidata(INST id, void _far * _far *data);
  900.    int SICLAPI isetsig(int sig_val);
  901.    int SICLAPI igetsig(int _far *sig_val);
  902.    int SICLAPI _export _siclcleanup(void); /* process cleanup for Win 3.1*/
  903.    int SICLAPI _export _setsiclyield(int); /* yield option for Win 3.1 */
  904.    int SICLAPI igetblockmode( INST id, short *mode );
  905. #endif
  906.  
  907. #else /* __STDC__ || __cplusplus || _MS_DOS_WIN || _SICL_WIN32 */
  908.    /* Old C (ie. not ANSI C or C++) */
  909.    /* Version */
  910.    int iversion();
  911.    int idrvrversion();
  912.  
  913.    /* Open/Close */
  914.    INST iopen();
  915.    int iclose();
  916.    INST igetintfsess();
  917.    
  918.    /* Read/Write */
  919.    int iwrite();
  920.    int iread();
  921.    int itermchr();
  922.    int igettermchr();
  923.  
  924. /* Formatted I/O */
  925.    int iprintf ();
  926.    int ivprintf ();
  927.    int isprintf ();
  928.    int isvprintf ();
  929.  
  930.    int iscanf ();
  931.    int ivscanf ();
  932.    int isscanf ();
  933.    int isvscanf ();
  934.  
  935.    int ipromptf ();
  936.    int ivpromptf ();
  937.  
  938.    int ifwrite ();
  939.    int ifread ();
  940.  
  941.    int iflush ();
  942.    int isetbuf ();
  943.    int isetubuf ();
  944.    
  945.    /* Device/Interface Control */
  946.    int iclear();
  947.    int iabort();
  948.    int ilocal ();
  949.    int iremote ();
  950.    int ireadstb();
  951.    int itrigger();
  952.    int ixtrig();
  953.    int ihint();
  954.    
  955.    /* Commander Sessions */
  956.    int isetstb();
  957.  
  958.    /* Service Requests */
  959.    int ionsrq();
  960.    int igetonsrq();
  961.    
  962.    /* Interrupts */
  963.    int ionintr();
  964.    int igetonintr();
  965.    int isetintr();
  966.    
  967.    /* Asynchronous Events Control */
  968.    int iintroff();
  969.    int iintron();
  970.    int iwaithdlr();
  971.    
  972.    /* Locking */
  973.    int ilock();
  974.    int iunlock();
  975.    int isetlockwait();
  976.    int igetlockwait();
  977.    
  978.    /* Timeouts */
  979.    int itimeout();
  980.    int igettimeout();
  981.    
  982.    /* Misc. Functions */
  983.    int igetaddr();
  984.    int isetdata();
  985.    int igetdata();
  986.    int igetintftype();
  987.    int igetsesstype();
  988.    int igetdevaddr();
  989.    int igetlu();
  990.    int ibeswap();
  991.    int ileswap();
  992.    int iswap();
  993.    int igetlulist();
  994.    int igetluinfo();
  995.    int igetgatewaytype();
  996.    
  997.    /* Error Handling */
  998.    int ionerror();
  999.    int igetonerror();
  1000.    void I_ERROR_EXIT();
  1001.    void I_ERROR_NO_EXIT();
  1002.    int igeterrno ();
  1003.    char _far *igeterrstr ();
  1004.    void icauseerr ();
  1005.  
  1006. /* RS-232 specific functions */
  1007.    int iserialmclctrl ();
  1008.    int iserialmclstat ();
  1009.    int iserialctrl ();
  1010.    int iserialstat ();
  1011.    int iserialbreak ();
  1012.  
  1013. /* VXI Specific functions */
  1014.    int ivxibusstatus();
  1015.    int ivxiwaitnormop();
  1016.    int ivxitrigon();
  1017.    int ivxitrigoff();
  1018.    int ivxitrigroute();
  1019.    int ivxigettrigroute();
  1020.    int ivxiws();
  1021.    int ivxiservants();
  1022.    int ivxirminfo();
  1023.  
  1024. #if defined(_MS_DOS_WIN) || defined(_SICL_WIN32)
  1025.    void ibpoke();
  1026.    void iwpoke();
  1027.    void ilpoke();
  1028.    unsigned char ibpeek();
  1029.    unsigned short iwpeek();
  1030.    unsigned long ilpeek();
  1031. #endif 
  1032.  
  1033. /* GP-IB Specific functions */
  1034.    int igpibbusstatus();
  1035.    int igpibppoll();
  1036.    int igpibppollconfig();
  1037.    int igpibppollresp();
  1038.    int igpibpassctl();
  1039.    int igpibrenctl();
  1040.    int igpibatnctl();
  1041.    int igpibsendcmd();
  1042.    int igpibbusaddr ();
  1043.    int igpibllo ();
  1044.    int igpibpulseifc ();
  1045.    
  1046. /* GPIO Specific functions */
  1047.    int igpioctrl();
  1048.    int igpiostat();
  1049.    int igpiosetwidth();
  1050.    int igpiogetwidth();
  1051.  
  1052. /* MSIB Specific functions */
  1053.    int imsibeventmask();
  1054.    int imsibcmd();
  1055.    int imsibseterror();
  1056.    int imsibclearerror();
  1057.    int imsibinfo();
  1058.    int imsibmodule();
  1059.    int imsibsetstb();
  1060.  
  1061. /* LAN Specific functions */
  1062.    int ilantimeout();
  1063.    int ilangettimeout();
  1064.  
  1065.    /* Map routines */
  1066.    char _far *imap();
  1067.    int iunmap();
  1068.    int imapinfo();
  1069.    int ibblockcopy();
  1070.    int iwblockcopy();
  1071.    int ilblockcopy();
  1072.    int ibpushfifo();
  1073.    int iwpushfifo();
  1074.    int ilpushfifo();
  1075.    int ibpopfifo();
  1076.    int iwpopfifo();
  1077.    int ilpopfifo();
  1078.    
  1079.    int icmd();
  1080.  
  1081.    /* These are not standard SICL routines */
  1082. #if !defined(STD_SICL)
  1083.    int itrace();
  1084.    int isetcscpidata();
  1085.    int igetcscpidata();
  1086.    int isetsig();
  1087.    int igetsig();
  1088.    int igetblockmode();
  1089. #endif
  1090.    
  1091. #endif /* __STDC__ || __cplusplus || _MS_DOS_WIN || _SICL_WIN32 */
  1092.  
  1093. #endif /* ! SICL_NOPROTO */
  1094.  
  1095. /* Peek/Poke Macros */
  1096.  
  1097. #if !defined(_MS_DOS_WIN) && !defined(_SICL_WIN32)
  1098. /* Lynx/Fantasia VXI interface needs a FIFO check before the dereference on
  1099.  * VXI writes -- BJS
  1100.  */
  1101. #if defined(_SICL_LYNX_FA)
  1102.  
  1103. /* This global (defined and initialized by SICL) is a pointer to the Universe
  1104.  * MISC_STAT register.
  1105.  */
  1106. extern volatile unsigned long *sicl_universe_misc_stat;
  1107.  
  1108. /* UNIVERSE_FIFO_WAIT waits until the Universe write FIFO is empty */
  1109. #define UNIVERSE_FIFO_WAIT \
  1110.    do { \
  1111.    } while ((*sicl_universe_misc_stat & 0x00040000L) == 0)
  1112.  
  1113. /* In the i*poke macros below, don't even consider removing the outer
  1114.  * "do { } while (0)" structure.  This "trick" makes these macros into a
  1115.  * single incomplete statement, so they behave like the old i*poke macros.
  1116.  */
  1117. #define ibpoke(addr,val) \
  1118. do { \
  1119.    UNIVERSE_FIFO_WAIT; \
  1120.    (*(unsigned volatile char *)(addr)) = ((unsigned char)(val)); \
  1121. } while (0)
  1122.  
  1123. #define iwpoke(addr,val) \
  1124. do { \
  1125.    UNIVERSE_FIFO_WAIT; \
  1126.    (*(unsigned volatile short *)(addr)) = ((unsigned short)(val)); \
  1127. } while (0)
  1128.  
  1129. #define ilpoke(addr,val) \
  1130. do { \
  1131.    UNIVERSE_FIFO_WAIT; \
  1132.    (*(unsigned volatile long *)(addr)) = ((unsigned long)(val)); \
  1133. } while (0)
  1134.  
  1135. #define ibpeek(addr) *((unsigned volatile char *)(addr))
  1136. #define iwpeek(addr) *((unsigned volatile short *)(addr))
  1137. #define ilpeek(addr) *((unsigned volatile long *)(addr))
  1138.  
  1139. #else /* ! Lynx/Fantasia */
  1140. #define ibpoke(addr,val) (*(unsigned volatile char _far *)(addr))=((unsigned char)(val))
  1141. #define iwpoke(addr,val) (*(unsigned volatile short _far *)(addr))=((unsigned short)(val))
  1142. #define ilpoke(addr,val) (*(unsigned volatile long _far *)(addr))=((unsigned long)(val))
  1143. #define ibpeek(addr) *((unsigned volatile char _far *)(addr))
  1144. #define iwpeek(addr) *((unsigned volatile short _far *)(addr))
  1145. #define ilpeek(addr) *((unsigned volatile long _far *)(addr))
  1146. #endif /* ! Lynx/Fantasia */
  1147. #endif /* ! _MS_DOS_WIN */
  1148.  
  1149. /* define VXI word serial commands for ivxiws() */
  1150. #if defined(I_SICL_VXI) && !defined(STD_SICL)
  1151. /* Misc. Word Serial Defines */
  1152. #define  WS_BNO_TOP_LVL    0x0100
  1153.  
  1154. /* Word Serial Commands */
  1155. #define  WS_CMD_ANO     0xc8ff
  1156. #define     WS_MASK_ANO    0xffff
  1157. #define  WS_CMD_AHL     0xa900
  1158. #define     WS_MASK_AHL    0xff00
  1159. #define  WS_CMD_AIL     0xaa00
  1160. #define     WS_MASK_AIL    0xff00
  1161. #define  WS_CMD_AMC     0xa800
  1162. #define     WS_MASK_AMC    0xff00
  1163. #define  WS_CMD_BNO     0xfcff
  1164. #define     WS_MASK_BNO    0xfeff
  1165. #define  WS_CMD_BA      0xbc00
  1166. #define  WS_CMD_BA_END     0xbd00
  1167. #define     WS_MASK_BA     0xfe00
  1168. #define  WS_CMD_BR      0xdeff
  1169. #define     WS_MASK_BR     0xffff
  1170. #define  WS_CMD_CLR     0xffff
  1171. #define     WS_MASK_CLR    0xffff
  1172. #define  WS_CMD_CL      0xefff
  1173. #define     WS_MASK_CL     0xffff
  1174. #define  WS_CMD_CE      0xaf00
  1175. #define     WS_MASK_CE     0xff00
  1176. #define  WS_CMD_ENO     0xc9ff
  1177. #define     WS_MASK_ENO    0xffff
  1178. #define  WS_CMD_RPE     0xcdff
  1179. #define     WS_MASK_RPE    0xffff
  1180. #define  WS_CMD_GD      0xbf00
  1181. #define     WS_MASK_GD     0xff00
  1182. #define  WS_CMD_IC      0xbe00
  1183. #define     WS_MASK_IC     0xff00
  1184. #define  WS_CMD_RHL     0x8c00
  1185. #define     WS_MASK_RHL    0xff00
  1186. #define  WS_CMD_RH      0xc7ff   
  1187. #define     WS_MASK_RH     0xffff
  1188. #define  WS_CMD_RIL     0x8d00
  1189. #define     WS_MASK_RIL    0xff00
  1190. #define  WS_CMD_RI      0xcaff
  1191. #define     WS_MASK_RI     0xffff
  1192. #define  WS_CMD_RMOD    0xccff
  1193. #define     WS_MASK_RMOD      0xffff
  1194. #define  WS_CMD_RP      0xdfff
  1195. #define     WS_MASK_RP     0xffff
  1196. #define  WS_CMD_RSTB    0xcfff
  1197. #define     WS_MASK_RSTB      0xffff
  1198. #define  WS_CMD_RSA     0xceff
  1199. #define     WS_MASK_RSA    0xffff
  1200. #define  WS_CMD_RD      0x8e00
  1201. #define     WS_MASK_RD     0xff00
  1202. #define  WS_CMD_CR      0x8f00
  1203. #define     WS_MASK_CR     0xff00
  1204. #define  WS_CMD_SL      0xeeff
  1205. #define     WS_MASK_SL     0xffff
  1206. #define  WS_CMD_SLMOD      0xae00
  1207. #define     WS_MASK_SLMOD     0xff00
  1208. #define  WS_CMD_SUMOD      0xad00
  1209. #define     WS_MASK_SUMOD     0xff00
  1210. #define  WS_CMD_TRIG    0xedff
  1211. #define     WS_MASK_TRIG      0xffff
  1212. #define  WS_CMD_USER    0x0000
  1213. #define     WS_MASK_USER      0x8000
  1214.  
  1215. #endif  /* VXI WS support */
  1216.  
  1217. /*
  1218.  * This is a collection of macros and entry points needed for
  1219.  * backwards compatability for SICL.  They are now a collection
  1220.  * of non-standard HPIB/GPIB macros.
  1221.  */
  1222. #if ! defined(STD_SICL)
  1223. #define I_SICL_HPIB        /* GP-IB ==> HP-IB */
  1224. #define I_INTF_HPIB  I_INTF_GPIB /* GP-IB ==> HP-IB */
  1225.  
  1226.  
  1227. #define I_INTR_HPIB_IFC       16
  1228. #define I_INTR_HPIB_PPOLLCONFIG     17
  1229. #define I_INTR_HPIB_REMLOC    18
  1230.  
  1231. #define I_HPIB_BUS_REM     I_GPIB_BUS_REM
  1232. #define I_HPIB_BUS_SRQ     I_GPIB_BUS_SRQ
  1233. #define I_HPIB_BUS_NDAC    I_GPIB_BUS_NDAC
  1234. #define I_HPIB_BUS_SYSCTLR I_GPIB_BUS_SYSCTLR
  1235. #define I_HPIB_BUS_ACTCTLR I_GPIB_BUS_ACTCTLR
  1236. #define I_HPIB_BUS_TALKER  I_GPIB_BUS_TALKER
  1237. #define I_HPIB_BUS_LISTENER   I_GPIB_BUS_LISTENER
  1238. #define I_HPIB_BUS_ADDR    I_GPIB_BUS_ADDR
  1239.  
  1240. #define ihpibbusstatus     igpibbusstatus
  1241. #define ihpibppoll      igpibppoll
  1242. #define ihpibppollconfig   igpibppollconfig
  1243. #define ihpibpassctl    igpibpassctl
  1244. #define ihpibrenctl     igpibrenctl
  1245. #define ihpibatnctl     igpibatnctl
  1246. #define ihpibsendcmd    igpibsendcmd
  1247. #endif
  1248.  
  1249. #if defined(__cplusplus)
  1250.    };
  1251. #endif
  1252.  
  1253. #endif /* SICL_H */
  1254.